<!DOCTYPE html>
<html lang='default'>

<head>
  <meta name="generator" content="Hexo 6.3.0">
  <meta name="hexo-theme" content="https://github.com/xaoxuu/hexo-theme-stellar/tree/1.18.5">
  <meta charset="utf-8">
  

  <meta http-equiv='x-dns-prefetch-control' content='on' />
  <link rel='dns-prefetch' href='https://gcore.jsdelivr.net'>
  <link rel="preconnect" href="https://gcore.jsdelivr.net" crossorigin>
  <link rel='dns-prefetch' href='//unpkg.com'>

  <meta name="renderer" content="webkit">
  <meta name="force-rendering" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="HandheldFriendly" content="True" >
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="theme-color" content="#f8f8f8">
  
  <title>安装基于Hexo和Github Page的个人博客 - LiYunpeng's Blog</title>

  
    <meta name="description" content="Gitee Pages 的使用此处之所以选择Gitee、而不是Github活着Gitlab，有几个原因  第一因为国内网络的复杂环境问题； 第二是对于上传图片，Gitee有自带的图床，随时随地写到Issues，活着Wiki里，截图直接粘贴就会自动生成图片地址和相应代码了，非常方便，当然，其实本文中的管理后台也可以实现这个功能，会传到生成的源码中，占用项目空间，所以用Gitee的图床再好不过了；">
<meta property="og:type" content="article">
<meta property="og:title" content="安装基于Hexo和Github Page的个人博客">
<meta property="og:url" content="http://yoursite.com/2018/12/15/%E5%AE%89%E8%A3%85%E5%9F%BA%E4%BA%8EHelo%E5%92%8CGithub-Page%E7%9A%84%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/index.html">
<meta property="og:site_name" content="LiYunpeng&#39;s Blog">
<meta property="og:description" content="Gitee Pages 的使用此处之所以选择Gitee、而不是Github活着Gitlab，有几个原因  第一因为国内网络的复杂环境问题； 第二是对于上传图片，Gitee有自带的图床，随时随地写到Issues，活着Wiki里，截图直接粘贴就会自动生成图片地址和相应代码了，非常方便，当然，其实本文中的管理后台也可以实现这个功能，会传到生成的源码中，占用项目空间，所以用Gitee的图床再好不过了；">
<meta property="og:locale">
<meta property="og:image" content="https://images.gitee.com/uploads/images/2018/1215/182557_74cc7c82_90802.png">
<meta property="og:image" content="https://images.gitee.com/uploads/images/2018/1215/193634_ef7fe751_90802.png">
<meta property="og:image" content="https://images.gitee.com/uploads/images/2018/1215/181659_dfb837ea_90802.png">
<meta property="og:image" content="https://images.gitee.com/uploads/images/2018/1215/181315_343a5cb9_90802.png">
<meta property="og:image" content="https://images.gitee.com/uploads/images/2018/1215/181510_d08cfdcd_90802.png">
<meta property="og:image" content="https://images.gitee.com/uploads/images/2018/1215/204800_585724c0_90802.png">
<meta property="og:image" content="https://images.gitee.com/uploads/images/2018/1215/210046_8dc982a9_90802.png">
<meta property="og:image" content="https://images.gitee.com/uploads/images/2018/1215/210224_16b8e605_90802.png">
<meta property="og:image" content="https://images.gitee.com/uploads/images/2018/1215/210635_2a9a33c7_90802.png">
<meta property="article:published_time" content="2018-12-15T08:22:00.000Z">
<meta property="article:modified_time" content="2023-02-21T08:33:26.000Z">
<meta property="article:author" content="LiYunpeng">
<meta property="article:tag" content="个人博客">
<meta property="article:tag" content="Github Pages">
<meta property="article:tag" content="hexo">
<meta property="article:tag" content="日常工具">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://images.gitee.com/uploads/images/2018/1215/182557_74cc7c82_90802.png">
  
  

  <!-- feed -->
  

  
    
<link rel="stylesheet" href="/css/main.css">

  

  

  

  


  
</head>

<body>
  




  <div class='l_body' id='start'>
    <aside class='l_left' layout='post'>
    

  

<header class="header"><div class="logo-wrap"><a class="title" href="/"><div class="main" ff="title">LiYunpeng's Blog</div></a></div>

<nav class="menu dis-select"></nav>
</header>


<div class="widgets">
<widget class="widget-wrapper search"><div class="widget-body"><div class="search-wrapper" id="search"><form class="search-form"><input type="text" class="search-input" id="search-input" data-filter="/blog/" placeholder="文章搜索"><svg t="1670596976048" class="icon search-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2676" width="200" height="200"><path d="M938.2 832.6L723.8 618.1c-2.5-2.5-5.3-4.4-7.9-6.4 36.2-55.6 57.3-121.8 57.3-193.1C773.3 222.8 614.6 64 418.7 64S64 222.8 64 418.6c0 195.9 158.8 354.6 354.6 354.6 71.3 0 137.5-21.2 193.2-57.4 2 2.7 3.9 5.4 6.3 7.8L832.5 938c14.6 14.6 33.7 21.9 52.8 21.9 19.1 0 38.2-7.3 52.8-21.8 29.2-29.1 29.2-76.4 0.1-105.5M418.7 661.3C284.9 661.3 176 552.4 176 418.6 176 284.9 284.9 176 418.7 176c133.8 0 242.6 108.9 242.6 242.7 0 133.7-108.9 242.6-242.6 242.6" p-id="2677"></path></svg></form><div id="search-result"></div><div class="search-no-result">No Results!</div></div></div></widget>


<widget class="widget-wrapper toc single" id="data-toc"><div class="widget-header cap dis-select"><span class="name">安装基于Hexo和Github Page的个人博客</span></div><div class="widget-body fs14"><div class="doc-tree active"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#Gitee-Pages-%E7%9A%84%E4%BD%BF%E7%94%A8"><span class="toc-text">Gitee Pages 的使用</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%85%B7%E4%BD%93%E7%9A%84%E5%88%9B%E5%BB%BA%E6%96%B9%E5%BC%8F%E5%BE%88%E7%AE%80%E5%8D%95"><span class="toc-text">具体的创建方式很简单</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%81%87%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98"><span class="toc-text">遇到的问题</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AE%A1%E7%90%86%E5%8D%9A%E5%AE%A2%E7%95%8C%E9%9D%A2"><span class="toc-text">管理博客界面</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%89%E8%A3%85"><span class="toc-text">安装</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%91%E5%B8%83%E5%8D%9A%E5%AE%A2"><span class="toc-text">发布博客</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8hexo-admin%E5%8F%91%E5%B8%83"><span class="toc-text">使用hexo-admin发布</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8%E5%91%BD%E4%BB%A4%E5%8F%91%E5%B8%83"><span class="toc-text">使用命令发布</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85Next%E4%B8%BB%E9%A2%98"><span class="toc-text">安装Next主题</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%AF%84%E8%AE%BA%E5%8A%9F%E8%83%BD"><span class="toc-text">评论功能</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E9%98%85%E8%AF%BB%E9%87%8F%E7%9A%84%E7%BB%9F%E8%AE%A1"><span class="toc-text">阅读量的统计</span></a></li></ol></div></div></widget>




</div>


    </aside>
    <div class='l_main'>
      

      



<div class="bread-nav fs12"><div id="breadcrumb"><a class="cap breadcrumb" href="/">Home</a><span class="sep"></span><a class="cap breadcrumb" href="/">Blog</a><span class="sep"></span><a class="cap breadcrumb-link" href="/categories/%E6%97%A5%E5%B8%B8%E5%B7%A5%E5%85%B7/">日常工具</a></div><div id="post-meta">Posted on&nbsp;<time datetime="2018-12-15T08:22:00.000Z">2018-12-15</time></div></div>

<article class='md-text content post'>
<h1 class="article-title"><span>安装基于Hexo和Github Page的个人博客</span></h1>
<h3 id="Gitee-Pages-的使用"><a href="#Gitee-Pages-的使用" class="headerlink" title="Gitee Pages 的使用"></a>Gitee Pages 的使用</h3><p>此处之所以选择Gitee、而不是Github活着Gitlab，有几个原因</p>
<ul>
<li>第一因为国内网络的复杂环境问题；</li>
<li>第二是对于上传图片，Gitee有自带的图床，随时随地写到Issues，活着Wiki里，截图直接粘贴就会自动生成图片地址和相应代码了，非常方便，当然，其实本文中的管理后台也可以实现这个功能，会传到生成的源码中，占用项目空间，所以用Gitee的图床再好不过了；</li>
</ul>
<h4 id="具体的创建方式很简单"><a href="#具体的创建方式很简单" class="headerlink" title="具体的创建方式很简单"></a>具体的创建方式很简单</h4><p>在Gitee创建一个项目，和你在Gitee上的名称保持一致，然后，在项目页，选择服务，Gitee Pages服务，创建即可，此处要求你得绑定手机才有权限开通此服务，如下图<br><img class="lazy" src="" data-src="https://images.gitee.com/uploads/images/2018/1215/182557_74cc7c82_90802.png" alt="输入图片说明" title="屏幕截图.png"></p>
<h3 id="遇到的问题"><a href="#遇到的问题" class="headerlink" title="遇到的问题"></a>遇到的问题</h3><p>安装还算顺利，仅遇到了一个问题，在执行hexo d的时候，停留在了这里<code>delete mode 100644 placeholder</code>。<br>其实只要自己提交一下到Git上就可以了，以后就不会有这个问题了，可能是没有找到仓库或者什么其他原因吧。  </p>
<h3 id="管理博客界面"><a href="#管理博客界面" class="headerlink" title="管理博客界面"></a>管理博客界面</h3><p>Github：<a target="_blank" rel="noopener" href="https://github.com/jaredly/hexo-admin">https://github.com/jaredly/hexo-admin</a><br>官网：<a target="_blank" rel="noopener" href="https://jaredforsyth.com/hexo-admin/">https://jaredforsyth.com/hexo-admin/</a>  </p>
<h4 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h4><p>在项目所在的目录执行<code>npm install --save hexo-admin</code>,<br>用yarn就是 <code>yarn add hexo-admin</code>，<br>然后<code>hexo server d</code>之后，访问<br><a target="_blank" rel="noopener" href="http://localhost:4000/admin%E5%B0%B1%E5%8F%AF%E4%BB%A5%E4%BA%86">http://localhost:4000/admin就可以了</a></p>
<h3 id="发布博客"><a href="#发布博客" class="headerlink" title="发布博客"></a>发布博客</h3><p>通过上面的管理页面创建博客并发布会非常方便，发不完之后，会在对应的目录下生成相关的.md文件，其实就相当于是调用了hexo的post命令创建并编辑的  </p>
<h4 id="使用hexo-admin发布"><a href="#使用hexo-admin发布" class="headerlink" title="使用hexo-admin发布"></a>使用hexo-admin发布</h4><p>hexo-admin为我们已经提供了发布的工具，我们需要在我们的项目中创建一个发布的脚本，拿我本地来讲，MacOS，创建一个.sh可运行文件，比如我叫hexo-deploy.sh，内容如下</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">!/usr/bin/env sh</span></span><br><span class="line">hexo deploy -g</span><br><span class="line">```  </span><br><span class="line">同时要在_config.yml中追加如下片段，指向这个.sh文件</span><br><span class="line">```yml</span><br><span class="line">admin:</span><br><span class="line">  deployCommand: &#x27;./hexo-deploy.sh&#x27;</span><br></pre></td></tr></table></figure>
<p>此处记得要授权，否则没有权限执行，chmod a+x hexo-deploy.sh<br>这样的话，在我们的Hexo Admin页面中的Deploy中，就可以直接发布了，如下图<br><img class="lazy" src="" data-src="https://images.gitee.com/uploads/images/2018/1215/193634_ef7fe751_90802.png" alt="输入图片说明" title="屏幕截图.png"></p>
<h4 id="使用命令发布"><a href="#使用命令发布" class="headerlink" title="使用命令发布"></a>使用命令发布</h4><p>其实使用命令发布也就是上面.sh文件里的内容了，直接执行。<br>可以通过<code>hexo d -g</code>命令来进行全局发布，会按照对应的主体生成静态html代码，生成到.deply_git文件夹下，与此同时，也会将生成后的文件推送到远端的Git仓库中，此处不用担心本地的配置文件推送上去，他只会推送.deply_git这个文件夹</p>
<p><code>需要注意</code>，如果你想把本地的hexo项目也保存起来，可以将此项目推送到私有仓库，免得泄露自己的配置文件中的敏感信息</p>
<h3 id="安装Next主题"><a href="#安装Next主题" class="headerlink" title="安装Next主题"></a>安装Next主题</h3><p>因为网上这个资料是最多的，所以毫不犹豫的选择这个主题，不是因为是否好看，而是稳定且出问题可以借鉴。毕竟上了年纪，更懂得什么时候需要稳定，什么时候需要探索。<br>官网：<a target="_blank" rel="noopener" href="https://theme-next.org/">https://theme-next.org/</a><br>官方Github：<a target="_blank" rel="noopener" href="https://github.com/theme-next/hexo-theme-next/tree/v6.0.6">https://github.com/theme-next/hexo-theme-next/tree/v6.0.6</a><br>注意有类似的叫相同名字的其他个人Git</p>
<p>####安装<br>进入到项目文件夹下的theme文件夹，然后clone项目<br>git clone <a target="_blank" rel="noopener" href="https://github.com/theme-next/hexo-theme-next">https://github.com/theme-next/hexo-theme-next</a><br>然后将_config.yml中对应原来默认生成的theme文件夹下的主体替换为hexo-theme-next，也就是新下载的文件夹，类似如下目录<br><img class="lazy" src="" data-src="https://images.gitee.com/uploads/images/2018/1215/181659_dfb837ea_90802.png" alt="输入图片说明" title="屏幕截图.png"></p>
<h3 id="评论功能"><a href="#评论功能" class="headerlink" title="评论功能"></a>评论功能</h3><p>此处使用的是Valine，在Next主题的配置文件中进行配置安装，依赖于如下平台<br>官网<a target="_blank" rel="noopener" href="https://leancloud.cn/">https://leancloud.cn/</a>  </p>
<p>在此平台注册后，在管理后台创建App，并生成对应的appId和appKey，然后配置到Next主题的配置文件中，即可使用</p>
<p><img class="lazy" src="" data-src="https://images.gitee.com/uploads/images/2018/1215/181315_343a5cb9_90802.png" alt="![输入图片说明](https://images.gitee.com/uploads/images/2018/1215/181318_daab3406_90802.png &quot;屏幕截图.png&quot;)" title="屏幕截图.png">  </p>
<p>如图所示，替换对应theme主体下_config.yml中，搜索Valine片段，替换对应appId和appKey<br><img class="lazy" src="" data-src="https://images.gitee.com/uploads/images/2018/1215/181510_d08cfdcd_90802.png" alt="输入图片说明" title="屏幕截图.png"></p>
<p>此处还需要注意一点，就是需要在leancloud平台上的设置里，安全菜单里增加安全域名，也就是自己的网站域名，否则评论功能是无法使用的</p>
<h3 id="阅读量的统计"><a href="#阅读量的统计" class="headerlink" title="阅读量的统计"></a>阅读量的统计</h3><p>此处不得不再说关于Next主题真的是支持的内容很多，还是上面的leancloud.cn平台，里面的数据库，我们增加一张用来统计文章阅读量的表Counter，类似如下图<br><img class="lazy" src="" data-src="https://images.gitee.com/uploads/images/2018/1215/204800_585724c0_90802.png" alt="输入图片说明" title="屏幕截图.png"></p>
<p>然后在Next主题的配置文件中查找leancloud_visitors，在下面配置好之前配置的appId和appKey即可</p>
<p>此处注意，因为LeanCloud有一个安全bug，所以还需要安装一个组件<br><code>yarn add hexo-leancloud-counter-security</code><br>来自<a target="_blank" rel="noopener" href="https://github.com/theme-next/hexo-leancloud-counter-security">https://github.com/theme-next/hexo-leancloud-counter-security</a><br>操作很复杂，我们一步一步来说</p>
<ul>
<li><p>安装<br>yarn add hexo-leancloud-counter-security ，或者像官网的npm安装  </p>
</li>
<li><p>增加配置  </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">leancloud_counter_security:</span><br><span class="line">  enable_sync: true</span><br><span class="line">  app_id: &lt;&lt;your app id&gt;&gt;</span><br><span class="line">  app_key: &lt;&lt;your app key&gt;&gt;</span><br><span class="line">  username: &lt;&lt;your username&gt;&gt; # Will be asked while deploying if is left blank</span><br><span class="line">  password: &lt;&lt;your password&gt;&gt; # Recommmended to be left blank. Will be asked while deploying if is left blank</span><br></pre></td></tr></table></figure>
<p>此处配置app_id和app_key和上面一样，都是leancloud的，说一下用户名和密码，我们此处借助于这个安全插件来实现部署，以确保我们html中访问数量不会轻易被窜改，所以会去和数据库中做对比，从安全考虑，我们稍后要创建一个用户名来操作线上数据库，此处来填写用户名密码是为了部署的时候，不用手动输入，如果不填写，每次部署的时候手动输入也可以</p>
</li>
<li><p>更改部署类型  </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line">      type: leancloud_counter_security_sync</span><br></pre></td></tr></table></figure>
<p>此处不再使用git来进行部署，而是使用这个插件来部署</p>
</li>
<li><p>创建用户  </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo lc-counter register &lt;&lt;username&gt;&gt; &lt;&lt;password&gt;&gt;</span><br></pre></td></tr></table></figure>
<p>刚才说到的要创建的用户名，这个账号会创建到leancloud里，然后进行分配权限</p>
</li>
<li><p>分配权限<br><img class="lazy" src="" data-src="https://images.gitee.com/uploads/images/2018/1215/210046_8dc982a9_90802.png" alt="输入图片说明" title="屏幕截图.png"><br>粘贴如下代码  </p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">var query = new AV.Query(&quot;Counter&quot;);</span><br><span class="line">if (request.object.updatedKeys.indexOf(&#x27;time&#x27;) !== -1) &#123;</span><br><span class="line">    return query.get(request.object.id).then(function (obj) &#123;</span><br><span class="line">        if (obj.get(&quot;time&quot;) + 1 !== request.object.get(&quot;time&quot;)) &#123;</span><br><span class="line">            throw new AV.Cloud.Error(&#x27;Invalid update!&#x27;);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p><img class="lazy" src="" data-src="https://images.gitee.com/uploads/images/2018/1215/210224_16b8e605_90802.png" alt="输入图片说明" title="屏幕截图.png"><br>保存之后点部署–生产环境</p>
</li>
<li><p>授权<br><img class="lazy" src="" data-src="https://images.gitee.com/uploads/images/2018/1215/210635_2a9a33c7_90802.png" alt="输入图片说明" title="屏幕截图.png"><br>如上图，存储–&gt;Counter–&gt;其他–&gt;权限设置中，对三个地方进行指定用户，也就是把刚才注册的用户添加进来，此处按理说会查询到自动补全的</p>
</li>
</ul>
<p>致辞，记录访问数量也就算完成了，此处比较麻烦，还是因为安全漏洞太多导致的。</p>


<div class="article-footer reveal fs14"><section id="license"><div class="header"><span>License</span></div><div class="body"><p>本文采用 <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">署名-非商业性使用-相同方式共享 4.0 国际</a> 许可协议，转载请注明出处。</p>
</div></section></div>

</article>

<div class="related-wrap reveal" id="read-next"><section class="body"><div class="item" id="prev"><div class="note">Newer</div><a href="/2023/02/20/%E4%BB%A5%E5%A4%AA%E5%9D%8A%E6%BA%90%E7%A0%81%E9%98%85%E8%AF%BB%E2%80%94%E2%80%94%E7%AC%AC%E4%B8%80%E7%AF%87/">以太坊源码阅读——第一篇</a></div><div class="item" id="next"><div class="note">Older</div><a href="/2018/12/15/hello-world/">Hello World</a></div></section></div>








      
<footer class="page-footer reveal fs12"><hr><div class="text"><p>本站由 <a href="/">@anonymity</a> 使用 <a target="_blank" rel="noopener" href="https://github.com/xaoxuu/hexo-theme-stellar">Stellar</a> 主题创建。<br>本博客所有文章除特别声明外，均采用 <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> 许可协议，转载请注明出处。</p>
</div></footer>

      <div class='float-panel mobile-only blur' style='display:none'>
  <button type='button' class='sidebar-toggle mobile' onclick='sidebar.toggle()'>
    <svg class="icon" style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15301"><path d="M566.407 808.3c26.9-0.1 49.3-20.8 51.6-47.6-1.9-27.7-23.9-49.7-51.6-51.6h-412.6c-28.2-1.4-52.6 19.5-55.5 47.6 2.3 26.8 24.6 47.5 51.6 47.6h416.5v4z m309.3-249.9c26.9-0.1 49.3-20.8 51.6-47.6-2.2-26.8-24.6-47.5-51.6-47.6h-721.9c-27.7-2.8-52.5 17.4-55.3 45.1-0.1 0.8-0.1 1.7-0.2 2.5 0.9 27.2 23.6 48.5 50.7 47.6H875.707z m-103.1-245.9c26.9-0.1 49.3-20.8 51.6-47.6-0.4-28.3-23.2-51.1-51.5-51.6h-618.9c-29.5-1.1-54.3 21.9-55.5 51.4v0.2c1.4 27.8 25.2 49.2 53 47.8 0.8 0 1.7-0.1 2.5-0.2h618.8z" p-id="15302"></path><path d="M566.407 808.3c26.9-0.1 49.3-20.8 51.6-47.6-1.9-27.7-23.9-49.7-51.6-51.6h-412.6c-28.2-1.4-52.6 19.5-55.5 47.6 1.9 27.7 23.9 49.7 51.6 51.6h416.5z m309.3-249.9c26.9-0.1 49.3-20.8 51.6-47.6-2.2-26.8-24.6-47.5-51.6-47.6h-721.9c-27.7-2.8-52.5 17.4-55.3 45.1-0.1 0.8-0.1 1.7-0.2 2.5 0.9 27.2 23.6 48.5 50.7 47.6H875.707z m-103.1-245.9c26.9-0.1 49.3-20.8 51.6-47.6-0.4-28.3-23.2-51.1-51.5-51.6h-618.9c-29.5-1.1-54.3 21.9-55.5 51.4v0.2c1.4 27.8 25.2 49.2 53 47.8 0.8 0 1.7-0.1 2.5-0.2h618.8z" p-id="15303"></path></svg>
  </button>
</div>

    </div>
  </div>
  <div class='scripts'>
    <script type="text/javascript">
  const stellar = {
    // 懒加载 css https://github.com/filamentgroup/loadCSS
    loadCSS: (href, before, media, attributes) => {
      var doc = window.document;
      var ss = doc.createElement("link");
      var ref;
      if (before) {
        ref = before;
      } else {
        var refs = (doc.body || doc.getElementsByTagName("head")[0]).childNodes;
        ref = refs[refs.length - 1];
      }
      var sheets = doc.styleSheets;
      if (attributes) {
        for (var attributeName in attributes) {
          if (attributes.hasOwnProperty(attributeName)) {
            ss.setAttribute(attributeName, attributes[attributeName]);
          }
        }
      }
      ss.rel = "stylesheet";
      ss.href = href;
      ss.media = "only x";
      function ready(cb) {
        if (doc.body) {
          return cb();
        }
        setTimeout(function () {
          ready(cb);
        });
      }
      ready(function () {
        ref.parentNode.insertBefore(ss, before ? ref : ref.nextSibling);
      });
      var onloadcssdefined = function (cb) {
        var resolvedHref = ss.href;
        var i = sheets.length;
        while (i--) {
          if (sheets[i].href === resolvedHref) {
            return cb();
          }
        }
        setTimeout(function () {
          onloadcssdefined(cb);
        });
      };
      function loadCB() {
        if (ss.addEventListener) {
          ss.removeEventListener("load", loadCB);
        }
        ss.media = media || "all";
      }
      if (ss.addEventListener) {
        ss.addEventListener("load", loadCB);
      }
      ss.onloadcssdefined = onloadcssdefined;
      onloadcssdefined(loadCB);
      return ss;
    },

    // 从 butterfly 和 volantis 获得灵感
    loadScript: (src, opt) => new Promise((resolve, reject) => {
      var script = document.createElement('script');
      if (src.startsWith('/')){
        src = stellar.config.root + src.substring(1);
      }
      script.src = src;
      if (opt) {
        for (let key of Object.keys(opt)) {
          script[key] = opt[key]
        }
      } else {
        // 默认异步，如果需要同步，第二个参数传入 {} 即可
        script.async = true
      }
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    }),

    // https://github.com/jerryc127/hexo-theme-butterfly
    jQuery: (fn) => {
      if (typeof jQuery === 'undefined') {
        stellar.loadScript(stellar.plugins.jQuery).then(fn)
      } else {
        fn()
      }
    }
  };
  stellar.version = '1.18.5';
  stellar.github = 'https://github.com/xaoxuu/hexo-theme-stellar/tree/1.18.5';
  stellar.config = {
    date_suffix: {
      just: 'Just',
      min: 'minutes ago',
      hour: 'hours ago',
      day: 'days ago',
      month: 'months ago',
    },
    root : '/',
  };

  // required plugins (only load if needs)
  stellar.plugins = {
    jQuery: 'https://gcore.jsdelivr.net/npm/jquery@3.6.2/dist/jquery.min.js'
  };

  if ('local_search') {
    stellar.search = {};
    stellar.search.service = 'local_search';
    if (stellar.search.service == 'local_search') {
      let service_obj = Object.assign({}, {"field":"all","path":"/search.json","content":true,"sort":"-date"});
      stellar.search[stellar.search.service] = service_obj;
    }
  }

  // stellar js
  stellar.plugins.stellar = Object.assign({"sites":"/js/plugins/sites.js","friends":"/js/plugins/friends.js","ghinfo":"/js/plugins/ghinfo.js","timeline":"/js/plugins/timeline.js","linkcard":"/js/plugins/linkcard.js","fcircle":"/js/plugins/fcircle.js","weibo":"/js/plugins/weibo.js"});

  stellar.plugins.marked = Object.assign("https://cdn.bootcdn.net/ajax/libs/marked/4.0.18/marked.min.js");
  // optional plugins
  if ('true' == 'true') {
    stellar.plugins.lazyload = Object.assign({"enable":true,"js":"https://gcore.jsdelivr.net/npm/vanilla-lazyload@17.8.3/dist/lazyload.min.js","transition":"blur"});
  }
  if ('true' == 'true') {
    stellar.plugins.swiper = Object.assign({"enable":true,"css":"https://unpkg.com/swiper@8.4.5/swiper-bundle.min.css","js":"https://unpkg.com/swiper@8.4.5/swiper-bundle.min.js"});
  }
  if ('' == 'true') {
    stellar.plugins.scrollreveal = Object.assign({"enable":null,"js":"https://gcore.jsdelivr.net/npm/scrollreveal@4.0.9/dist/scrollreveal.min.js","distance":"8px","duration":500,"interval":100,"scale":1});
  }
  if ('true' == 'true') {
    stellar.plugins.preload = Object.assign({"enable":true,"service":"flying_pages","instant_page":"https://gcore.jsdelivr.net/gh/volantis-x/cdn-volantis@4.1.2/js/instant_page.js","flying_pages":"https://gcore.jsdelivr.net/gh/gijo-varghese/flying-pages@2.1.2/flying-pages.min.js"});
  }
  if ('true' == 'true') {
    stellar.plugins.fancybox = Object.assign({"enable":true,"js":"https://gcore.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js","css":"https://gcore.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css","selector":".swiper-slide img"});
  }
  if ('false' == 'true') {
    stellar.plugins.heti = Object.assign({"enable":false,"css":"https://unpkg.com/heti@0.9.2/umd/heti.min.css","js":"https://unpkg.com/heti@0.9.2/umd/heti-addon.min.js"});
  }
</script>

<!-- required -->

  
<script src="/js/main.js" async></script>



<!-- optional -->



<!-- inject -->


  </div>
</body>
</html>
